// 此文件专门负责项目的路由
import { createRouter, createWebHashHistory } from 'vue-router'

// 通过懒加载方式，引入组件
const routes = [
    {
      path: '/',
      name: 'Home',
      component: () => import('@/views/home/index.vue')
    },
    {
      path: '/login',
      component: () => import('@/views/login/index.vue')
    },
    {
      path: '/register',
      component: () => import('@/views/register/index.vue')
    },
    {
      path: '/admin',
      component: () => import('@/views/admin/index.vue')
    },
  ]

// 创建并暴露一个路由器
const router = createRouter({
    history: createWebHashHistory(),
    routes
})

export default router;
